{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "b4f979b1-2761-4c53-aa15-ed95bfa4164b",
   "metadata": {},
   "outputs": [
    {
     "name": "stdin",
     "output_type": "stream",
     "text": [
      "数字是？ 1\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "无十位数\n"
     ]
    }
   ],
   "source": [
    "def thedecimal(number):\n",
    "    import re\n",
    "    numberStr = str(number)\n",
    "    matchFore = re.search(r'\\.',numberStr)\n",
    "    if matchFore:\n",
    "        if number<10:\n",
    "            return \"无十位数\"\n",
    "        else:\n",
    "            return re.search(r'(\\d)(?=\\d(?:\\.))',str(number)).group(1)\n",
    "    else:\n",
    "        if number<10:\n",
    "            return \"无十位数\"\n",
    "        else:\n",
    "            return re.search(r'(\\d)(?=\\d(?:$))',numberStr).group(1)\n",
    "print(thedecimal(float(input(\"数字是？\"))))"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
